Skip to content

feature/random xp config#758

Merged
sven-n merged 10 commits into
MUnique:masterfrom
eduardosmaniotto:feature/party-xp
May 29, 2026
Merged

feature/random xp config#758
sven-n merged 10 commits into
MUnique:masterfrom
eduardosmaniotto:feature/party-xp

Conversation

@eduardosmaniotto
Copy link
Copy Markdown
Contributor

@eduardosmaniotto eduardosmaniotto commented Apr 21, 2026

Random XP calculation configs that use current values as default. To disable random XP, update the new configs to 0.

@eduardosmaniotto eduardosmaniotto marked this pull request as ready for review April 21, 2026 17:28
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new experience bonus system for parties to encourage group play and diversity in character classes. It updates the party logic to calculate experience based on party size and composition, while simultaneously removing the previous random factor in XP distribution to provide more predictable rewards.

Highlights

  • Party Size XP Bonus: Implemented a dynamic XP multiplier based on party size, granting a 1% bonus per party member.
  • Set Party Bonus: Added an additional 2% XP bonus for parties with 3 or more members, provided each member has a unique character class.
  • XP Calculation Refinement: Removed the random variance from XP calculations to ensure consistent experience rewards.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a dynamic experience bonus system for parties, rewarding larger groups and diverse character class compositions. It refactors the experience distribution logic in Party.cs and Player.cs, notably removing the random variation from solo experience gains. A critical issue was identified in the new party experience calculation, which currently omits the multiplier for the number of recipients, resulting in party members receiving significantly less experience than intended.

Comment thread src/GameLogic/Party.cs Outdated
Copy link
Copy Markdown
Member

@sven-n sven-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the original season 6 behavior, and that was with random exp. I'm also not sure if the exp bonuses for a full party of mixed classes was just 2%, I remember it was even higher.
It would be great if you could add some Stats, so that every admin can configure the desired behavior.

Comment thread src/GameLogic/Player.cs Outdated
Comment thread src/GameLogic/Party.cs Outdated
Comment thread src/GameLogic/Party.cs Outdated
@eduardosmaniotto eduardosmaniotto requested a review from sven-n April 27, 2026 23:59
@eduardosmaniotto eduardosmaniotto changed the title feature/party xp bonus feature/random xp config May 29, 2026
@eduardosmaniotto eduardosmaniotto marked this pull request as draft May 29, 2026 17:35
@eduardosmaniotto
Copy link
Copy Markdown
Contributor Author

@sven-n I've reduced the scope of this PR, removing everything related to the party bonus. Now this only adds configurable random XP calculation configs.
Also, after refactoring and extracting to local variables, I noticed that it already has a hardcoded party bonus (only general, not for a set party).

input.webm.mp4

@eduardosmaniotto eduardosmaniotto marked this pull request as ready for review May 29, 2026 18:02
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces customizable random experience multipliers (RandomExperienceMinMultiplier and RandomExperienceMaxMultiplier) to replace the hardcoded 0.8 to 1.2 multiplier range when calculating experience gains for players and parties. It also includes database update plugins to initialize these new attributes across different game versions.

Feedback: There is a potential server crash risk in both Party.cs and Player.cs if the configured minimum multiplier is greater than or equal to the maximum multiplier, or if float rounding causes the calculated minimum experience to equal or exceed the maximum experience. In these cases, Rand.NextInt will throw an ArgumentOutOfRangeException. It is recommended to add a guard check to ensure min < max before calling Rand.NextInt.

Comment thread src/GameLogic/Party.cs
Comment thread src/GameLogic/Player.cs
Copy link
Copy Markdown
Member

@sven-n sven-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

@sven-n sven-n merged commit 062f98b into MUnique:master May 29, 2026
2 of 3 checks passed
@eduardosmaniotto eduardosmaniotto deleted the feature/party-xp branch May 29, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants